﻿@model IEnumerable<TopArtFinalProject.Models.Song>

@{
    ViewBag.Title = "Index";
}
@foreach (var item in Model)
{

    <div class="divPostRow">
        <div class="divPost">
            <img class="postImg" src="~/Images/ladyinred.jpeg"/>
          
            <div class="divPostInfo">
                Post of:@Html.ActionLink(item.UserName, "Search", new { search = item.UserName , searchType = "UserName" })<br />
                <h1>@Html.DisplayFor(modelItem => item.Title)</h1> <br />
                Artist: @Html.ActionLink(item.Artist, "Search", new { search = item.Artist , searchType = "Artist" })<br />
                Genre:@Html.ActionLink(item.Genre, "Search", new { search = item.Genre , searchType = "Genre" })<br />
                Album: @Html.ActionLink(item.Album, "Search", new { search = item.Album, searchType = "Album" })<br />
                Relesed on:@Html.DisplayFor(modelItem=>item.ReleseDate.Date.Year)<br />
               
            </div>
        </div>
        <div class="divRating">
            Avg Rating: have to caluculate
            <!-- we have to build it-->
            <div class="divRatingLabel">
                <!--
                @{
    //var totalVotes = item.FiveStars + item.FourStars + item.ThreeStars + item.TwoStars + item.OneStars;
    //var average = (5 * item.FiveStars + 4 * item.FourStars + 3 * item.ThreeStars + 2 * item.TwoStars + 1 * item.OneStars) / totalVotes;
    // @average from @totalVotes votes            
    }
               
                    -->
            </div>
        </div>
        <div class="divSocialInfo">
            <div class="divYoutube">
                <div class="g-ytsubcribe" data-channel=@item.YoutubeChannel data-layout="default" data-count="default"></div>
            </div>
            <div class="divFacebook">
                <div class="fb-like" data-href=@item.FacebookLink data-layout="button_count" data-action="like" data-show-faces="false" data-share="false"></div>
            </div>
            <div class="divTwetter">
                <a class="twitter-share-button" href=@item.TwitterLink data-via="Notepad_plus">Tweet</a>
            </div>
            <div class="divGoogle">
                <div class="g-plusone"></div>
            </div>

        </div>
        <div class="divHiddenDetail">
            five stars: @item.FiveStars
            <br />four stars: @item.FourStars

            <br />Three stars: @item.ThreeStars

            <br />Two stars: @item.TwoStars

            <br />One stars: @item.OneStars
            <br />

            @Html.Partial("_DisplayRating", item)


            @Html.ActionLink("Edit", "Edit", new { id = item.SongID }) |
            @Html.ActionLink("Details", "Details", new { id = item.SongID }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.SongID })
      
            
          </div>
        <div class="divExpandDetail">⇊⇓⇊</div>
    </div>

}